package com.mall.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mall.dao.UserAddrMapper;
import com.mall.entity.UserAddr;
import com.mall.service.UserAddrService;
import com.mall.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserAddrServiceImpl implements UserAddrService {

    @Autowired
    private UserAddrMapper userAddrMapper;
    @Override
    public ResultVO listAddrsByUid(String userId) {
        UserAddr userAddr=new UserAddr();
        userAddr.setUserId(userId);
        QueryWrapper<UserAddr> qw=new QueryWrapper<>(userAddr);
        List<UserAddr> userAddrs = userAddrMapper.selectList(qw);
        return ResultVO.success(userAddrs);
    }
}
